package me.springboot.mybatis.common.utils;

import me.springboot.mybatis.exception.ResultException;
import me.springboot.mybatis.model.User;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2018/5/7 0007.
 */
public class RoleType {

    public static boolean isKehu(HttpServletRequest request) throws ResultException {
        User user = SessionUtil.getSessionUser(request);
        if (user.getType().equals("3")) {
            return true;
        }
        return false;
    }

    public static boolean isXunJian(HttpServletRequest request) throws ResultException {
        User user = SessionUtil.getSessionUser(request);
        if (user.getType().equals("2")) {
            return true;
        }
        return false;
    }

    public static boolean isSystemUser(HttpServletRequest request) throws ResultException {
        User user = SessionUtil.getSessionUser(request);
        if (user.getType().equals("1")) {
            return true;
        }
        return false;
    }
}
